﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace NotMyBoom
{
    public class MyButton : VisibleGameEntity
    {
        public MyButton(ContentManager content, string[] strTextures, int nTexture, Vector2 topleft, Vector2 size)
        {
            InitMyButton(content, strTextures, nTexture, ref topleft, ref size);
        }

        public MyButton(ContentManager content, string strTexturesPrefix, int nTexture, Vector2 topleft, Vector2 size)
        {
            string[] strTextures = new string[nTexture];
            for (int i = 0; i < nTexture; i++)
                strTextures[i] = strTexturesPrefix + (i + 1).ToString("00");
            InitMyButton(content, strTextures, nTexture, ref topleft, ref size);
        }
       
        private void InitMyButton(ContentManager content, string[] strTextures, int nTexture, ref Vector2 topleft, ref Vector2 size)
        {
            _TopLeft = topleft;
            _Size = size;
            Texture2D[] textures = new Texture2D[nTexture];
            for (int i = 0; i < nTexture; i++)
                textures[i] = content.Load<Texture2D>(strTextures[i]);
            Sprites = new List<My2DSprite>();
            My2DSprite temp = new My2DSprite(textures, nTexture, topleft);
            Sprites.Add(temp);
            _nSprite = 1;
        }
    }
}
